package com.boss.mvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.boss.services.PersonService;


@Controller
@RequestMapping("/person")
public class PersonAction {
	@Autowired(required=false)
	PersonService personService;
	@RequestMapping("/view")
	public ModelAndView view() {
		String text=personService.sayHi();
		ModelAndView mav = new ModelAndView();
		mav.setViewName("index");
		mav.addObject("hello",text);
		return mav; 
	}
}
